package com.seamtop.cuber.web.service.impl;

import com.seamtop.cuber.common.entriy.JobRecord;
import com.seamtop.cuber.web.dao.JobRecordDao;
import com.seamtop.cuber.web.service.JobRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by zongjunfeng on 2015/9/22.
 */
@Service
public class JobRecordServiceImpl implements JobRecordService {


    @Autowired
    private JobRecordDao jobRecordDao;

    @Override
    public int addJobRecord(JobRecord jobRecord) {
        jobRecordDao.addJobRecord(jobRecord);
        return jobRecord.getId();
    }

    @Override
    public List<JobRecord> findJobList() {
        return jobRecordDao.findJobList();
    }

    @Override
    public List<JobRecord> findJobListByReducer(String reducerId) {
        return jobRecordDao.findJobListByReducer(reducerId);
    }

    @Override
    public void updateJobRecord(JobRecord jobRecord) {
        jobRecordDao.updateJobRecord(jobRecord);
    }
}
